API Documentation
StringView.h
1 // StringView.h
3 //
5 
6 namespace nkMemory
7 {
21  class StringView final
22  {
23  public :
24 
36  StringView (const char* data) ;
45  StringView (const char* data, unsigned long long size) ;
51  StringView (const nkLog::StringView& logStr) ;
58  StringView (const String& other) ;
63 
64  // Getters
68  const char* getData () const ;
72  unsigned long long getSize () const ;
76  bool empty () const ;
80  char front () const ;
84  char back () const ;
85 
86  // Operators
92  StringView& operator= (const char* data) ;
98  StringView& operator= (const String& other) ;
104  char operator[] (unsigned long long index) const ;
111  String operator+ (char c) const ;
118  String operator+ (const char* data) const ;
125  String operator+ (const StringView& other) const ;
132  bool operator== (const char* other) const ;
139  bool operator== (const StringView& other) const ;
146  bool operator!= (const char* other) const ;
153  bool operator!= (const StringView& other) const ;
154 
155  public :
156 
163  StringView (const std::string& str) ;
172  StringView (const std::string& str, unsigned long long index, unsigned long long size = 0ull) ;
179  StringView (const std::string_view& str) ;
188  StringView (const std::string_view& str, unsigned long long index, unsigned long long size = 0ull) ;
189 
190  public :
191 
195  operator std::string () const ;
199  operator std::string_view () const ;
203  operator nkLog::String () const ;
207  operator nkLog::StringView () const ;
208 
215  StringView& operator= (const std::string& data) ;
222  StringView& operator= (const std::string_view& data) ;
223  } ;
224 
232  inline bool operator== (const char* c, const nkMemory::StringView& str) ;
233 }
nkMemory::StringView::empty
bool empty() const
nkLog::StringView
Allows to exchange strings with external code.
Definition: StringView.h:18
nkMemory::StringView::~StringView
~StringView()
nkMemory::StringView::StringView
StringView(const nkLog::StringView &logStr)
nkMemory::StringView::StringView
StringView(const std::string &str, unsigned long long index, unsigned long long size=0ull)
nkMemory::StringView::StringView
StringView(const std::string_view &str)
nkMemory::StringView::operator!=
bool operator!=(const char *other) const
nkMemory::StringView::StringView
StringView(const std::string &str)
nkMemory::StringView::operator[]
char operator[](unsigned long long index) const
nkMemory::StringView::StringView
StringView(const char *data)
nkMemory::StringView::operator==
bool operator==(const char *other) const
nkMemory::StringView::StringView
StringView(const char *data, unsigned long long size)
nkMemory::StringView::StringView
StringView()
nkMemory::operator==
bool operator==(const char *c, const nkMemory::String &str)
nkMemory::StringView::operator+
String operator+(char c) const
nkMemory::StringView::front
char front() const
nkMemory::StringView::getSize
unsigned long long getSize() const
nkMemory::StringView::getData
const char * getData() const
nkMemory::String
Class holding information about a string, with ownership over the data.
Definition: String.h:22
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkMemory::StringView::StringView
StringView(const std::string_view &str, unsigned long long index, unsigned long long size=0ull)
nkMemory::StringView::operator=
StringView & operator=(const char *data)
nkMemory::StringView::back
char back() const
nkMemory::StringView::StringView
StringView(const String &other)
nkMemory
Encompasses all API of component NilkinsMemory.
Definition: Allocator.h:7